package space.xxhui.DAO;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import space.xxhui.POJO.User;

@Mapper
public interface UserDao {
    int insert(@Param("pojo") User pojo);

    int insertSelective(@Param("pojo") User pojo);

    int insertList(@Param("pojos") List<User> pojo);

    int update(@Param("pojo") User pojo);

    //使用xml配置文件
    User getUserById(int id);
    //不使用配置文件使用注解
    @Select("Select * from user where id = #{id}")
    User getUserByIdForAnnotation(int id);
    @Select("Select * from user where name = #{user.name} and pwd = #{user.pwd}")
    User checkUser(@Param("user") User user);
}
